package com.finesys.backend.service.user;

import com.finesys.backend.common.model.base.BusinessResult;
import com.finesys.backend.common.model.base.PageRequest;
import com.finesys.backend.common.model.base.PageResult;
import com.finesys.backend.common.model.user.UserModel;

import java.util.List;

/**
 * <p>Title: 用户base service</p>
 * <p>Description: </p>
 * <p>Copyright: CopyRight (c) 2020-2035</p>
 * <p>Company: finesys Co. LTD.</p>
 * <p>Author: lehoon</p>
 * <p>Date: 2020.10.18</p>
 */
public interface UserService {
	/**基础统计数据*/
	BusinessResult<Long> queryUserCount();

	/**用户登陆*/
	BusinessResult<String> login(String username, String password, String remoteIp);

	/**校验token*/
	BusinessResult<UserModel> validateToken(String token);

	/**保存用户信息*/
	BusinessResult<UserModel> save(UserModel userModel);

	/**更新用户信息*/
	BusinessResult<String> update(UserModel userModel);

	/**根据id删除用户*/
	BusinessResult<String> delete(String id);

	/**退出系统  删除token*/
	BusinessResult<UserModel> logout(String token);

	/**分页查询*/
	BusinessResult<PageResult> findPage(PageRequest request);

	/**分页查询*/
	List<UserModel> findList();

	//检查token是否合法
	boolean checkTokenSign(String token, String ip);
}
